<!DOCTYPE html>
<html lang="zh-CN">
  <head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width,initial-scale=1">
    <title>React VR全景图组件 | Zelma&#39;s Blog</title>
    <meta name="generator" content="VuePress 1.8.2">
    <link rel="icon" href="/logo.png">
    <meta name="description" content="记录，成为更好的自己！">
    <meta name="viewport" content="width=device-width,initial-scale=1,user-scalable=no">
    
    <link rel="preload" href="/assets/css/0.styles.4cf3e643.css" as="style"><link rel="preload" href="/assets/js/app.6bff9ace.js" as="script"><link rel="preload" href="/assets/js/4.4f19eb35.js" as="script"><link rel="preload" href="/assets/js/1.085d100d.js" as="script"><link rel="preload" href="/assets/js/31.36528513.js" as="script"><link rel="prefetch" href="/assets/js/10.a9f8c063.js"><link rel="prefetch" href="/assets/js/11.104a9c15.js"><link rel="prefetch" href="/assets/js/12.2b5515f3.js"><link rel="prefetch" href="/assets/js/13.4b350042.js"><link rel="prefetch" href="/assets/js/14.c2117806.js"><link rel="prefetch" href="/assets/js/15.f122a822.js"><link rel="prefetch" href="/assets/js/16.b7b77918.js"><link rel="prefetch" href="/assets/js/17.ca19e9d9.js"><link rel="prefetch" href="/assets/js/18.86eacc78.js"><link rel="prefetch" href="/assets/js/19.a9eff237.js"><link rel="prefetch" href="/assets/js/20.1cc397e3.js"><link rel="prefetch" href="/assets/js/21.543a015c.js"><link rel="prefetch" href="/assets/js/22.319e4a6e.js"><link rel="prefetch" href="/assets/js/23.e60f5f5b.js"><link rel="prefetch" href="/assets/js/24.b3891c01.js"><link rel="prefetch" href="/assets/js/25.ed2e6b36.js"><link rel="prefetch" href="/assets/js/26.40d7e552.js"><link rel="prefetch" href="/assets/js/27.d5e7e0d7.js"><link rel="prefetch" href="/assets/js/28.10aa572b.js"><link rel="prefetch" href="/assets/js/29.acf9222c.js"><link rel="prefetch" href="/assets/js/3.74a0f1d8.js"><link rel="prefetch" href="/assets/js/30.ab8bfb83.js"><link rel="prefetch" href="/assets/js/32.f582544c.js"><link rel="prefetch" href="/assets/js/33.41a28fb2.js"><link rel="prefetch" href="/assets/js/34.73610167.js"><link rel="prefetch" href="/assets/js/35.f1ec0595.js"><link rel="prefetch" href="/assets/js/36.245a9409.js"><link rel="prefetch" href="/assets/js/37.c96cef21.js"><link rel="prefetch" href="/assets/js/38.ef989ff8.js"><link rel="prefetch" href="/assets/js/39.b6ac0196.js"><link rel="prefetch" href="/assets/js/40.f64953b6.js"><link rel="prefetch" href="/assets/js/5.c1ba3938.js"><link rel="prefetch" href="/assets/js/6.5bb669f5.js"><link rel="prefetch" href="/assets/js/7.0bd32045.js"><link rel="prefetch" href="/assets/js/8.a1032cf5.js"><link rel="prefetch" href="/assets/js/9.4f6fb2c7.js">
    <link rel="stylesheet" href="/assets/css/0.styles.4cf3e643.css">
  </head>
  <body>
    <div id="app" data-server-rendered="true"><div class="theme-container" data-v-1aefc0b4><div data-v-1aefc0b4><div id="loader-wrapper" class="loading-wrapper" data-v-d48f4d20 data-v-1aefc0b4 data-v-1aefc0b4><div class="loader-main" data-v-d48f4d20><div data-v-d48f4d20></div><div data-v-d48f4d20></div><div data-v-d48f4d20></div><div data-v-d48f4d20></div></div> <!----> <!----></div> <div class="password-shadow password-wrapper-out" style="display:none;" data-v-25ba6db2 data-v-1aefc0b4 data-v-1aefc0b4><h3 class="title" data-v-25ba6db2 data-v-25ba6db2>Zelma's Blog</h3> <p class="description" data-v-25ba6db2 data-v-25ba6db2>记录，成为更好的自己！</p> <label id="box" class="inputBox" data-v-25ba6db2 data-v-25ba6db2><input type="password" value="" data-v-25ba6db2> <span data-v-25ba6db2>Konck! Knock!</span> <button data-v-25ba6db2>OK</button></label> <div class="footer" data-v-25ba6db2 data-v-25ba6db2><span data-v-25ba6db2><i class="iconfont reco-theme" data-v-25ba6db2></i> <a target="blank" href="https://vuepress-theme-reco.recoluan.com" data-v-25ba6db2>vuePress-theme-reco</a></span> <span data-v-25ba6db2><i class="iconfont reco-copyright" data-v-25ba6db2></i> <a data-v-25ba6db2><span data-v-25ba6db2>zelma</span>
            
          <!---->
          2022
        </a></span></div></div> <div class="hide" data-v-1aefc0b4><header class="navbar" data-v-1aefc0b4><div class="sidebar-button"><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" role="img" viewBox="0 0 448 512" class="icon"><path fill="currentColor" d="M436 124H12c-6.627 0-12-5.373-12-12V80c0-6.627 5.373-12 12-12h424c6.627 0 12 5.373 12 12v32c0 6.627-5.373 12-12 12zm0 160H12c-6.627 0-12-5.373-12-12v-32c0-6.627 5.373-12 12-12h424c6.627 0 12 5.373 12 12v32c0 6.627-5.373 12-12 12zm0 160H12c-6.627 0-12-5.373-12-12v-32c0-6.627 5.373-12 12-12h424c6.627 0 12 5.373 12 12v32c0 6.627-5.373 12-12 12z"></path></svg></div> <a href="/" class="home-link router-link-active"><img src="/logo.png" alt="Zelma's Blog" class="logo"> <span class="site-name">Zelma's Blog</span></a> <div class="links"><div class="color-picker"><a class="color-button"><i class="iconfont reco-color"></i></a> <div class="color-picker-menu" style="display:none;"><div class="mode-options"><h4 class="title">Choose mode</h4> <ul class="color-mode-options"><li class="dark">dark</li><li class="auto active">auto</li><li class="light">light</li></ul></div></div></div> <div class="search-box"><i class="iconfont reco-search"></i> <input aria-label="Search" autocomplete="off" spellcheck="false" value=""> <!----></div> <nav class="nav-links can-hide"><div class="nav-item"><a href="/" class="nav-link"><i class="iconfont reco-home"></i>
  首页
</a></div><div class="nav-item"><div class="dropdown-wrapper"><a class="dropdown-title"><span class="title"><i class="iconfont reco-category"></i>
      分类
    </span> <span class="arrow right"></span></a> <ul class="nav-dropdown" style="display:none;"><li class="dropdown-item"><!----> <a href="/categories/随记/" class="nav-link"><i class="undefined"></i>
  随记
</a></li><li class="dropdown-item"><!----> <a href="/categories/工具/" class="nav-link"><i class="undefined"></i>
  工具
</a></li><li class="dropdown-item"><!----> <a href="/categories/JS设计模式/" class="nav-link"><i class="undefined"></i>
  JS设计模式
</a></li><li class="dropdown-item"><!----> <a href="/categories/git使用/" class="nav-link"><i class="undefined"></i>
  git使用
</a></li><li class="dropdown-item"><!----> <a href="/categories/业务场景交互具体实现/" class="nav-link"><i class="undefined"></i>
  业务场景交互具体实现
</a></li><li class="dropdown-item"><!----> <a href="/categories/技术分享/" class="nav-link"><i class="undefined"></i>
  技术分享
</a></li></ul></div></div><div class="nav-item"><a href="/tag/" class="nav-link"><i class="iconfont reco-tag"></i>
  标签
</a></div><div class="nav-item"><div class="dropdown-wrapper"><a class="dropdown-title"><span class="title"><i class="iconfont reco-message"></i>
      全部文档
    </span> <span class="arrow right"></span></a> <ul class="nav-dropdown" style="display:none;"><li class="dropdown-item"><!----> <a href="/docs/theme-reco/js/prototype.html" class="nav-link"><i class="undefined"></i>
  JS相关知识
</a></li><li class="dropdown-item"><!----> <a href="/docs/theme-reco/interactive/reactVr.html" aria-current="page" class="nav-link router-link-exact-active router-link-active"><i class="undefined"></i>
  交互具体实现
</a></li><li class="dropdown-item"><!----> <a href="/docs/theme-reco/designPattern/preface.html" class="nav-link"><i class="undefined"></i>
  JavaScript设计模式与开发实践
</a></li><li class="dropdown-item"><!----> <a href="/docs/theme-reco/git/gitNormal.html" class="nav-link"><i class="undefined"></i>
  Git学习
</a></li></ul></div></div><div class="nav-item"><a href="/timeline/" class="nav-link"><i class="iconfont reco-date"></i>
  时间线
</a></div><div class="nav-item"><div class="dropdown-wrapper"><a class="dropdown-title"><span class="title"><i class="iconfont reco-other"></i>
      工具
    </span> <span class="arrow right"></span></a> <ul class="nav-dropdown" style="display:none;"><li class="dropdown-item"><!----> <a href="/docs-tools/uploadImg.html" class="nav-link"><i class="undefined"></i>
  上传图片
</a></li></ul></div></div><div class="nav-item"><a href="/blogs/other/messageBoard.html" class="nav-link"><i class="iconfont reco-date"></i>
  留言板
</a></div> <!----></nav></div></header> <div class="sidebar-mask" data-v-1aefc0b4></div> <aside class="sidebar" data-v-1aefc0b4><div class="personal-info-wrapper" data-v-39576ba9 data-v-1aefc0b4><img src="/avatar.png" alt="author-avatar" class="personal-img" data-v-39576ba9> <h3 class="name" data-v-39576ba9>
    zelma
  </h3> <div class="num" data-v-39576ba9><div data-v-39576ba9><h3 data-v-39576ba9>25</h3> <h6 data-v-39576ba9>文章</h6></div> <div data-v-39576ba9><h3 data-v-39576ba9>6</h3> <h6 data-v-39576ba9>标签</h6></div></div> <ul class="social-links" data-v-39576ba9><li class="social-item" data-v-39576ba9><i class="iconfont reco-juejin" style="color:#f8b26a;" data-v-39576ba9></i></li><li class="social-item" data-v-39576ba9><i class="iconfont reco-mayun" style="color:#f26d6d;" data-v-39576ba9></i></li><li class="social-item" data-v-39576ba9><i class="iconfont reco-csdn" style="color:#f47e60;" data-v-39576ba9></i></li></ul> <hr data-v-39576ba9></div> <nav class="nav-links"><div class="nav-item"><a href="/" class="nav-link"><i class="iconfont reco-home"></i>
  首页
</a></div><div class="nav-item"><div class="dropdown-wrapper"><a class="dropdown-title"><span class="title"><i class="iconfont reco-category"></i>
      分类
    </span> <span class="arrow right"></span></a> <ul class="nav-dropdown" style="display:none;"><li class="dropdown-item"><!----> <a href="/categories/随记/" class="nav-link"><i class="undefined"></i>
  随记
</a></li><li class="dropdown-item"><!----> <a href="/categories/工具/" class="nav-link"><i class="undefined"></i>
  工具
</a></li><li class="dropdown-item"><!----> <a href="/categories/JS设计模式/" class="nav-link"><i class="undefined"></i>
  JS设计模式
</a></li><li class="dropdown-item"><!----> <a href="/categories/git使用/" class="nav-link"><i class="undefined"></i>
  git使用
</a></li><li class="dropdown-item"><!----> <a href="/categories/业务场景交互具体实现/" class="nav-link"><i class="undefined"></i>
  业务场景交互具体实现
</a></li><li class="dropdown-item"><!----> <a href="/categories/技术分享/" class="nav-link"><i class="undefined"></i>
  技术分享
</a></li></ul></div></div><div class="nav-item"><a href="/tag/" class="nav-link"><i class="iconfont reco-tag"></i>
  标签
</a></div><div class="nav-item"><div class="dropdown-wrapper"><a class="dropdown-title"><span class="title"><i class="iconfont reco-message"></i>
      全部文档
    </span> <span class="arrow right"></span></a> <ul class="nav-dropdown" style="display:none;"><li class="dropdown-item"><!----> <a href="/docs/theme-reco/js/prototype.html" class="nav-link"><i class="undefined"></i>
  JS相关知识
</a></li><li class="dropdown-item"><!----> <a href="/docs/theme-reco/interactive/reactVr.html" aria-current="page" class="nav-link router-link-exact-active router-link-active"><i class="undefined"></i>
  交互具体实现
</a></li><li class="dropdown-item"><!----> <a href="/docs/theme-reco/designPattern/preface.html" class="nav-link"><i class="undefined"></i>
  JavaScript设计模式与开发实践
</a></li><li class="dropdown-item"><!----> <a href="/docs/theme-reco/git/gitNormal.html" class="nav-link"><i class="undefined"></i>
  Git学习
</a></li></ul></div></div><div class="nav-item"><a href="/timeline/" class="nav-link"><i class="iconfont reco-date"></i>
  时间线
</a></div><div class="nav-item"><div class="dropdown-wrapper"><a class="dropdown-title"><span class="title"><i class="iconfont reco-other"></i>
      工具
    </span> <span class="arrow right"></span></a> <ul class="nav-dropdown" style="display:none;"><li class="dropdown-item"><!----> <a href="/docs-tools/uploadImg.html" class="nav-link"><i class="undefined"></i>
  上传图片
</a></li></ul></div></div><div class="nav-item"><a href="/blogs/other/messageBoard.html" class="nav-link"><i class="iconfont reco-date"></i>
  留言板
</a></div> <!----></nav> <ul class="sidebar-links"><li><section class="sidebar-group collapsable depth-0"><p class="sidebar-heading"><span>JS相关知识</span> <span class="arrow right"></span></p> <!----></section></li><li><section class="sidebar-group collapsable depth-0"><p class="sidebar-heading open"><span>业务场景交互具体实现</span> <span class="arrow down"></span></p> <ul class="sidebar-links sidebar-group-items"><li><a href="/docs/theme-reco/interactive/reactVr.html" aria-current="page" class="active sidebar-link">React VR全景图组件</a></li><li><a href="/docs/theme-reco/interactive/cssMove.html" class="sidebar-link">css实现文字卡拉OK、跑马灯效果</a></li><li><a href="/docs/theme-reco/interactive/moveable.html" class="sidebar-link">moveable一个可拖拽、缩放、旋转、对齐的库</a></li><li><a href="/docs/theme-reco/interactive/vr360.html" class="sidebar-link">超简单实现vr看房子、360全景图（附完整demo）</a></li><li><a href="/docs/theme-reco/interactive/bullet.html" class="sidebar-link">微信小程序纯CSS实现无限弹幕滚动</a></li></ul></section></li><li><section class="sidebar-group collapsable depth-0"><p class="sidebar-heading"><span>JavaScript设计模式与开发实践</span> <span class="arrow right"></span></p> <!----></section></li><li><section class="sidebar-group collapsable depth-0"><p class="sidebar-heading"><span>Git学习</span> <span class="arrow right"></span></p> <!----></section></li></ul> </aside> <div class="password-shadow password-wrapper-in" style="display:none;" data-v-25ba6db2 data-v-1aefc0b4><h3 class="title" data-v-25ba6db2 data-v-25ba6db2>React VR全景图组件</h3> <!----> <label id="box" class="inputBox" data-v-25ba6db2 data-v-25ba6db2><input type="password" value="" data-v-25ba6db2> <span data-v-25ba6db2>Konck! Knock!</span> <button data-v-25ba6db2>OK</button></label> <div class="footer" data-v-25ba6db2 data-v-25ba6db2><span data-v-25ba6db2><i class="iconfont reco-theme" data-v-25ba6db2></i> <a target="blank" href="https://vuepress-theme-reco.recoluan.com" data-v-25ba6db2>vuePress-theme-reco</a></span> <span data-v-25ba6db2><i class="iconfont reco-copyright" data-v-25ba6db2></i> <a data-v-25ba6db2><span data-v-25ba6db2>zelma</span>
            
          <!---->
          2022
        </a></span></div></div> <div data-v-1aefc0b4><main class="page"><section><div class="page-title"><h1 class="title">React VR全景图组件</h1> <div data-v-f875f3fc><i class="iconfont reco-account" data-v-f875f3fc><span data-v-f875f3fc>zelma</span></i> <i class="iconfont reco-date" data-v-f875f3fc><span data-v-f875f3fc>2022/8/13</span></i> <i class="iconfont reco-eye" data-v-f875f3fc><span id="/docs/theme-reco/interactive/reactVr.html" data-flag-title="Your Article Title" class="leancloud-visitors" data-v-f875f3fc><a class="leancloud-visitors-count" style="font-size:.9rem;font-weight:normal;color:#999;"></a></span></i> <i class="tags iconfont reco-tag" data-v-f875f3fc><span class="tag-item" data-v-f875f3fc>交互实现</span></i></div></div> <div class="theme-reco-content content__default"><h1 id="啥也不说-先上效果图"><a href="#啥也不说-先上效果图" class="header-anchor">#</a> 啥也不说，先上效果图</h1> <p>手机扫码即可，如果有问题可以刷新一下</p> <p><img src="https://p6-juejin.byteimg.com/tos-cn-i-k3u1fbpfcp/804b0bcfa7544b0d8f0903445eed035c~tplv-k3u1fbpfcp-watermark.image?" alt="image.png"></p> <p><a href="https://www.zuiaiwanqian.com/pannellum/index.html" target="_blank" rel="noopener noreferrer">pc 端预览地址<span><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg> <span class="sr-only">(opens new window)</span></span></a>
建议打开调式模式，使用手机模式查看</p> <h1 id="实现效果"><a href="#实现效果" class="header-anchor">#</a> 实现效果</h1> <p>react VR 全景图组件实现，超级简单，即下即用，只需要从 npm 上下载，配置所需要的场景资源，就能实现 VR 全景图效果，可调整 VR 显示效果，添加自定义热点，热点样式修改，自定义跳转场景，手机控制 VR 效果(场景随着手机一起动)，VR 全景图实例获取，多种方法事件等。</p> <h1 id="背景"><a href="#背景" class="header-anchor">#</a> 背景</h1> <p>在前面有一篇文章向大家介绍了如何使用 pannellum 插件去实现一个 VR 全景图，但是是使用原生的方式实现，在平时开发中，肯定是需要使用一个 UI 框架的，在后续工作中我使用 React 框架实现了全景图的功能，里面有一些坑，我一一踩过了之后，现在把他封装成一个 React 组件来使用，非常的方便</p> <h1 id="如何下载"><a href="#如何下载" class="header-anchor">#</a> 如何下载</h1> <p>我把组件上传到了<code>NPM</code>上，组件代码上传到了<code>github</code>上</p> <blockquote><p>npm 地址 https://www.npmjs.com/package/vr-react</p></blockquote> <blockquote><p>github 地址 https://github.com/zuiaiwanqian/vr-react</p></blockquote> <h1 id="使用方式"><a href="#使用方式" class="header-anchor">#</a> 使用方式</h1> <p>使用方式很简单，只需要使用 npm 下载组件，将组件引入并传入对应参数即可</p> <blockquote><p>npm i vr-react</p></blockquote> <h2 id="最简单的使用"><a href="#最简单的使用" class="header-anchor">#</a> 最简单的使用</h2> <div class="language-js line-numbers-mode"><pre class="language-js"><code><span class="token keyword">import</span> VrReact <span class="token keyword">from</span> <span class="token string">&quot;vr-react&quot;</span><span class="token punctuation">;</span>

<span class="token keyword">const</span> scenes <span class="token operator">=</span> <span class="token punctuation">{</span>
  <span class="token literal-property property">oneScene</span><span class="token operator">:</span> <span class="token punctuation">{</span>
    <span class="token literal-property property">type</span><span class="token operator">:</span> <span class="token string">&quot;equirectangular&quot;</span><span class="token punctuation">,</span>
    <span class="token literal-property property">panorama</span><span class="token operator">:</span> <span class="token string">&quot;https://pannellum.org/images/bma-1.jpg&quot;</span><span class="token punctuation">,</span>
  <span class="token punctuation">}</span><span class="token punctuation">,</span>
<span class="token punctuation">}</span><span class="token punctuation">;</span>
<span class="token operator">&lt;</span>VrReact scenes<span class="token operator">=</span><span class="token punctuation">{</span>scenes<span class="token punctuation">}</span> width<span class="token operator">=</span><span class="token string">&quot;100%&quot;</span> height<span class="token operator">=</span><span class="token string">&quot;100vh&quot;</span> <span class="token operator">/</span><span class="token operator">&gt;</span><span class="token punctuation">;</span>
</code></pre> <div class="line-numbers-wrapper"><span class="line-number">1</span><br><span class="line-number">2</span><br><span class="line-number">3</span><br><span class="line-number">4</span><br><span class="line-number">5</span><br><span class="line-number">6</span><br><span class="line-number">7</span><br><span class="line-number">8</span><br><span class="line-number">9</span><br></div></div><h2 id="添加全部参数的使用"><a href="#添加全部参数的使用" class="header-anchor">#</a> 添加全部参数的使用</h2> <div class="language-js line-numbers-mode"><pre class="language-js"><code><span class="token keyword">import</span> VrReact <span class="token keyword">from</span> <span class="token string">&quot;vr-react&quot;</span><span class="token punctuation">;</span>

<span class="token operator">&lt;</span>VrReact
  setViewer<span class="token operator">=</span><span class="token punctuation">{</span>setViewer<span class="token punctuation">}</span>
  config<span class="token operator">=</span><span class="token punctuation">{</span>config<span class="token punctuation">}</span>
  width<span class="token operator">=</span><span class="token string">&quot;100%&quot;</span>
  height<span class="token operator">=</span><span class="token string">&quot;100vh&quot;</span>
  firstSceneId<span class="token operator">=</span><span class="token string">&quot;oneScene&quot;</span>
  scenes<span class="token operator">=</span><span class="token punctuation">{</span>scenes<span class="token punctuation">}</span>
  hotSpots<span class="token operator">=</span><span class="token punctuation">{</span>hotSpots<span class="token punctuation">}</span>
  delayTime<span class="token operator">=</span><span class="token punctuation">{</span><span class="token number">0</span><span class="token punctuation">}</span>
<span class="token operator">/</span><span class="token operator">&gt;</span><span class="token punctuation">;</span>
</code></pre> <div class="line-numbers-wrapper"><span class="line-number">1</span><br><span class="line-number">2</span><br><span class="line-number">3</span><br><span class="line-number">4</span><br><span class="line-number">5</span><br><span class="line-number">6</span><br><span class="line-number">7</span><br><span class="line-number">8</span><br><span class="line-number">9</span><br><span class="line-number">10</span><br><span class="line-number">11</span><br><span class="line-number">12</span><br></div></div><p><b>上面例子的代码在项目仓库的<code>example/src/app.js</code></b></p> <p>所有参数的说明和使用方法在这个腾讯文档表格里面</p> <p><b>所有参数内容和使用方法都在这里面</b></p> <p>地址为<a href="https://docs.qq.com/document/DVnBFU2JGRlZyZVd1?u=2c6ef6be46a946bca1849351da5736ff" target="_blank" rel="noopener noreferrer">vr-react 参数文档<span><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg> <span class="sr-only">(opens new window)</span></span></a></p> <p>部分参数截图</p> <p><img src="https://p6-juejin.byteimg.com/tos-cn-i-k3u1fbpfcp/d5f4ea66766b4b01a6bd1d50c4363ec5~tplv-k3u1fbpfcp-watermark.image?" alt="image.png"></p> <h2 id="react-pannellum-实例的事件"><a href="#react-pannellum-实例的事件" class="header-anchor">#</a> react-pannellum 实例的事件</h2> <p>可以通过<code>setViewer</code>参数传递的函数得到当前 react-pannellum 的实例</p> <h3 id="监听事件与消除事件"><a href="#监听事件与消除事件" class="header-anchor">#</a> 监听事件与消除事件</h3> <div class="language-js line-numbers-mode"><pre class="language-js"><code><span class="token keyword">const</span> <span class="token punctuation">[</span>reactPannellum<span class="token punctuation">,</span> setReactPannellum<span class="token punctuation">]</span> <span class="token operator">=</span> <span class="token function">useState</span><span class="token punctuation">(</span><span class="token keyword">null</span><span class="token punctuation">)</span>

<span class="token function">useEffect</span><span class="token punctuation">(</span><span class="token punctuation">(</span><span class="token punctuation">)</span> <span class="token operator">=&gt;</span> <span class="token punctuation">{</span>
    <span class="token keyword">if</span> <span class="token punctuation">(</span><span class="token operator">!</span>reactPannellum<span class="token punctuation">)</span> <span class="token keyword">return</span>
    <span class="token keyword">const</span> <span class="token function-variable function">initLoad</span> <span class="token operator">=</span> <span class="token punctuation">(</span><span class="token punctuation">)</span> <span class="token operator">=&gt;</span> <span class="token punctuation">{</span><span class="token punctuation">}</span>
    reactPannellum<span class="token punctuation">.</span><span class="token function">on</span><span class="token punctuation">(</span><span class="token string">'load'</span><span class="token punctuation">,</span> initLoad<span class="token punctuation">)</span>
    <span class="token keyword">return</span> <span class="token punctuation">(</span><span class="token punctuation">)</span> <span class="token operator">=&gt;</span> <span class="token punctuation">{</span>
        reactPannellum<span class="token punctuation">.</span><span class="token function">off</span><span class="token punctuation">(</span><span class="token string">'load'</span><span class="token punctuation">,</span> initLoad<span class="token punctuation">)</span>
    <span class="token punctuation">}</span>
<span class="token punctuation">}</span><span class="token punctuation">,</span> <span class="token punctuation">[</span>reactPannellum<span class="token punctuation">]</span><span class="token punctuation">)</span>

<span class="token operator">&lt;</span>Pannellum
    setViewer<span class="token operator">=</span><span class="token punctuation">{</span>setReactPannellum<span class="token punctuation">}</span>
    <span class="token operator">...</span>
<span class="token operator">/</span><span class="token operator">&gt;</span>
</code></pre> <div class="line-numbers-wrapper"><span class="line-number">1</span><br><span class="line-number">2</span><br><span class="line-number">3</span><br><span class="line-number">4</span><br><span class="line-number">5</span><br><span class="line-number">6</span><br><span class="line-number">7</span><br><span class="line-number">8</span><br><span class="line-number">9</span><br><span class="line-number">10</span><br><span class="line-number">11</span><br><span class="line-number">12</span><br><span class="line-number">13</span><br><span class="line-number">14</span><br><span class="line-number">15</span><br></div></div><p>通过<code>on</code>监听事件，相当于于<code>addEventListener</code>，通过<code>off</code>消除监听事件，相当于<code>removeEventListener</code></p> <h3 id="所有的事件"><a href="#所有的事件" class="header-anchor">#</a> 所有的事件</h3> <h3 id="load"><a href="#load" class="header-anchor">#</a> <code>load</code></h3> <p>当全景图完成加载时触发，切换场景时，新场景也会触发该事件，并且能在该事件中通过<code>getScene()</code>方法拿到更新后的场景值 ID</p> <h3 id="scenechange"><a href="#scenechange" class="header-anchor">#</a> <code>scenechange</code></h3> <p>切换场景时触发，但在改事件中<code>getScene()</code>拿到的场景值 ID 是当前场景 ID，不是切换之后的场景值 ID</p> <h3 id="zoomchange"><a href="#zoomchange" class="header-anchor">#</a> <code>zoomchange</code></h3> <p>场景 hfov 更新时触发。将新的 HFOV 值传递给处理程序</p> <h3 id="fullscreenchange"><a href="#fullscreenchange" class="header-anchor">#</a> <code>fullscreenchange</code></h3> <p>当浏览器全屏状态改变时触发。将状态值传递给处理程序。</p> <h3 id="scenechangefadedone"><a href="#scenechangefadedone" class="header-anchor">#</a> <code>scenechangefadedone</code></h3> <p>如果指定了场景转换淡入淡出间隔，则在切换场景后淡入淡出完成时触发此事件</p> <h3 id="animatefinished"><a href="#animatefinished" class="header-anchor">#</a> <code>animatefinished</code></h3> <p>当任何动作/动画完成时触发，即当渲染器停止渲染新帧时。将最终俯仰、偏航和 HFOV 值传递给处理程序。</p> <h3 id="error"><a href="#error" class="header-anchor">#</a> <code>error</code></h3> <p>发生错误时触发。错误消息字符串被传递给事件侦听器。</p> <h3 id="errorcleared"><a href="#errorcleared" class="header-anchor">#</a> <code>errorcleared</code></h3> <p>清除错误时触发</p> <h3 id="mousedown"><a href="#mousedown" class="header-anchor">#</a> <code>mousedown</code></h3> <p>按下鼠标按钮时触发。传递<code>MouseEvent</code>给处理程序。</p> <h3 id="mouseup"><a href="#mouseup" class="header-anchor">#</a> <code>mouseup</code></h3> <p>释放鼠标按钮时触发。传递<code>MouseEvent</code>给处理程序。</p> <h3 id="touchstart"><a href="#touchstart" class="header-anchor">#</a> <code>touchstart</code></h3> <p>触摸开始时触发。传递<code>TouchEvent</code>给处理程序。</p> <h3 id="touchend"><a href="#touchend" class="header-anchor">#</a> <code>touchend</code></h3> <p>触摸结束时触发。传递<code>TouchEvent</code>给处理程序。</p> <h2 id="react-pannellum-实例的常用方法"><a href="#react-pannellum-实例的常用方法" class="header-anchor">#</a> react-pannellum 实例的常用方法</h2> <h3 id="解释一下pitch-yaw-hfov"><a href="#解释一下pitch-yaw-hfov" class="header-anchor">#</a> 解释一下<code>pitch</code> <code>yaw</code> <code>hfov</code></h3> <p>这几个值代表了 VR 全景图的视角变化，在<a href="https://docs.qq.com/document/DVnBFU2JGRlZyZVd1?u=2c6ef6be46a946bca1849351da5736ff" target="_blank" rel="noopener noreferrer">参数文档表格<span><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg> <span class="sr-only">(opens new window)</span></span></a>中也有很多体现</p> <ul><li><code>pitch</code> 水平方向上下移动角度 正值向上 负值向下，上下旋转角度控制</li> <li><code>yaw</code> 垂直方向左右旋转角度 正值向右 负值向左，左右旋转角度控制</li> <li><code>hfov</code> 摄像机视角，即缩放角度大小控制，值越小越近，值越大越远，视角远近控制</li></ul> <p>一张图解释</p> <p><img src="https://p6-juejin.byteimg.com/tos-cn-i-k3u1fbpfcp/853124bb165042b796d69afa9138c375~tplv-k3u1fbpfcp-watermark.image?" alt="image.png"></p> <blockquote><p>建议去多试试这几个值，就能明白什么意思了</p></blockquote> <h3 id="所有方法"><a href="#所有方法" class="header-anchor">#</a> 所有方法</h3> <h3 id="isloaded"><a href="#isloaded" class="header-anchor">#</a> isLoaded()</h3> <p>检查全景图是否加载完成。如果加载完成了，则返回<code>true</code>，否则返回 <code>false</code></p> <h3 id="getpitch"><a href="#getpitch" class="header-anchor">#</a> getPitch()</h3> <p>返回当前场景的 pitch 值</p> <h3 id="setpitch-pitch-animated-callback"><a href="#setpitch-pitch-animated-callback" class="header-anchor">#</a> setPitch(pitch, animated, callback)</h3> <p>设置当前场景的 pitch 值</p> <ul><li><code>pitch</code> pitch 值，数据类型为<code>number</code></li> <li><code>animated</code> 动画持续时间（以毫秒为单位）或 false 表示没有动画（可选，默认<code>1000</code>）</li> <li><code>callback</code> 动画结束时调用的函数</li></ul> <h3 id="getpitchbounds"><a href="#getpitchbounds" class="header-anchor">#</a> getPitchBounds()</h3> <p>返回允许的最小和最大 pitch 返回值为一个数组<code>Array[minPitch, maxPitch]</code></p> <h3 id="setpitchbounds-bounds"><a href="#setpitchbounds-bounds" class="header-anchor">#</a> setPitchBounds(bounds)</h3> <p>设置最小和最大 pitch <code>bounds</code>为一个数组<code>Array[minPitch, maxPitch]</code></p> <h3 id="getyaw"><a href="#getyaw" class="header-anchor">#</a> getYaw()</h3> <h3 id="setyaw-yaw-animated-callback"><a href="#setyaw-yaw-animated-callback" class="header-anchor">#</a> setYaw(yaw, animated, callback)</h3> <h3 id="getyawbounds"><a href="#getyawbounds" class="header-anchor">#</a> getYawBounds()</h3> <h3 id="setyawbounds-bounds"><a href="#setyawbounds-bounds" class="header-anchor">#</a> setYawBounds(bounds)</h3> <h3 id="gethfov"><a href="#gethfov" class="header-anchor">#</a> getHfov()</h3> <h3 id="sethfov-hfov-animated-callback"><a href="#sethfov-hfov-animated-callback" class="header-anchor">#</a> setHfov(hfov, animated, callback)</h3> <h3 id="gethfovbounds"><a href="#gethfovbounds" class="header-anchor">#</a> getHfovBounds()</h3> <h3 id="sethfovbounds-bounds"><a href="#sethfovbounds-bounds" class="header-anchor">#</a> setHfovBounds(bounds)</h3> <blockquote><p>这几个方法同上面方法一样，不过是获取和设置<code>pitch</code>，<code>yaw</code>，<code>hfov</code>这三个不同的值</p></blockquote> <h3 id="getnorthoffset"><a href="#getnorthoffset" class="header-anchor">#</a> getNorthOffset</h3> <p>返回全景图的北偏移</p> <h3 id="getrenderer"><a href="#getrenderer" class="header-anchor">#</a> getRenderer()</h3> <p>获取全景渲染器</p> <h3 id="setupdate"><a href="#setupdate" class="header-anchor">#</a> setUpdate()</h3> <p>为动态内容设置更新</p> <h3 id="lookat-pitch-yaw-hfov-animated-callback"><a href="#lookat-pitch-yaw-hfov-animated-callback" class="header-anchor">#</a> lookAt(pitch, yaw, hfov, animated, callback)</h3> <p>设置全景图新的查看角度，包含了<code>pitch</code>，<code>yaw</code>，<code>hfov</code>三个值</p> <h3 id="startautorotate-speed"><a href="#startautorotate-speed" class="header-anchor">#</a> startAutoRotate(speed)</h3> <p>开启自动旋转，<code>speed</code>自动旋转速度</p> <h3 id="stopautorotate"><a href="#stopautorotate" class="header-anchor">#</a> stopAutoRotate()</h3> <p>关闭自动旋转</p> <h3 id="stopmovement"><a href="#stopmovement" class="header-anchor">#</a> stopMovement()</h3> <p>停止所有运动</p> <h3 id="loadscene-sceneid-pitch-yaw-hfov"><a href="#loadscene-sceneid-pitch-yaw-hfov" class="header-anchor">#</a> loadScene(sceneId, pitch, yaw, hfov)</h3> <p>加载不同的场景</p> <ul><li><code>sceneId</code> 加载场景的 sceneId 值</li> <li><code>pitch</code> 场景加载好的初始 pitch 值，</li> <li><code>yaw</code> 场景加载好初始 yaw 值</li> <li><code>hfov</code> 场景加载好初始 hfov 值</li></ul> <h3 id="getscene"><a href="#getscene" class="header-anchor">#</a> getScene()</h3> <p>返回当前当前场景值 ID</p> <h3 id="addscene-sceneid-config"><a href="#addscene-sceneid-config" class="header-anchor">#</a> addScene(sceneId, config)</h3> <p>添加新的场景，需要重新配置 config</p> <h3 id="removescene-sceneid"><a href="#removescene-sceneid" class="header-anchor">#</a> removeScene(sceneId)</h3> <p>移除场景</p> <h3 id="togglefullscreen"><a href="#togglefullscreen" class="header-anchor">#</a> toggleFullscreen()</h3> <p>切换全屏操作</p> <h3 id="getconfig"><a href="#getconfig" class="header-anchor">#</a> getConfig()</h3> <p>返回当前场景配置的 config</p> <h3 id="getcontainer"><a href="#getcontainer" class="header-anchor">#</a> getContainer()</h3> <p>返回实例容器的 dom 元素</p> <h3 id="addhotspot-hs-sceneid"><a href="#addhotspot-hs-sceneid" class="header-anchor">#</a> addHotSpot(hs, sceneId)</h3> <p>在场景中添加热点信息</p> <ul><li><code>hs</code> 热点配置项，<a href="https://docs.qq.com/document/DVnBFU2JGRlZyZVd1?u=2c6ef6be46a946bca1849351da5736ff" target="_blank" rel="noopener noreferrer">参数文档表格<span><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg> <span class="sr-only">(opens new window)</span></span></a>中有具体配置解释</li> <li><code>sceneId</code> 需要添加热点的场景 ID 值</li></ul> <h3 id="removehotspot-hotspotid-sceneid"><a href="#removehotspot-hotspotid-sceneid" class="header-anchor">#</a> removeHotSpot(hotSpotId, sceneId)</h3> <p>在场景中移除热点信息</p> <ul><li><code>hotSpotId</code> 需要被移除热点的 id 值</li> <li><code>sceneId</code> 需要被移除热点的场景 ID 值</li></ul> <h3 id="resize"><a href="#resize" class="header-anchor">#</a> resize()</h3> <p>如果改变了实例容器的大小，则调用此方法</p> <h3 id="isorientationsupported"><a href="#isorientationsupported" class="header-anchor">#</a> isOrientationSupported()</h3> <p>检查是否支持设备方向控制，是返回<code>true</code>，否返回<code>false</code> 即控制手机方向会控制全景图位置</p> <h3 id="stoporientation"><a href="#stoporientation" class="header-anchor">#</a> stopOrientation()</h3> <p>停止设备控制方向</p> <h3 id="startorientation"><a href="#startorientation" class="header-anchor">#</a> startOrientation()</h3> <p>开始设备控制方向</p> <h3 id="isorientationactive"><a href="#isorientationactive" class="header-anchor">#</a> isOrientationActive</h3> <p>返回当前是否激活了设备控制方向</p> <h3 id="on"><a href="#on" class="header-anchor">#</a> on</h3> <p>监听实例的事件，相当于<code>addEventListener</code></p> <h3 id="off"><a href="#off" class="header-anchor">#</a> off</h3> <p>关闭监听实例的事件，相当于<code>removeEventListener</code></p> <h3 id="destory"><a href="#destory" class="header-anchor">#</a> destory()</h3> <p>销毁实例</p> <h1 id="结束语"><a href="#结束语" class="header-anchor">#</a> 结束语</h1> <p>这可以当作一个 VR 全景图的简单文档，核心还是使用 pannellum 插件实现，我不过是把这些配置项和方法重新封装了一遍，让你可以不去阅读更多的内容，能够快速的实现一个全景图, 如果觉得帮助到你了，<a href="https://github.com/zuiaiwanqian/vr-react" target="_blank" rel="noopener noreferrer">点个赞给个星吧<span><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg> <span class="sr-only">(opens new window)</span></span></a>，最后的最后，如果你觉得该组件满足不了你的需求，可以自己去使用原生的<a href="https://pannellum.org/" target="_blank" rel="noopener noreferrer">pannellum<span><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg> <span class="sr-only">(opens new window)</span></span></a>实现</p></div></section> <footer class="page-edit"><!----> <div class="last-updated"><span class="prefix">Last Updated: </span> <span class="time">2022/8/13 下午1:52:23</span></div></footer> <div class="page-nav"><p class="inner"><span class="prev"><a href="/docs/theme-reco/js/onEmit.html" class="prev">
            发布订阅模式理解与应用
          </a></span> <span class="next"><a href="/docs/theme-reco/interactive/cssMove.html">
            css实现文字卡拉OK、跑马灯效果
          </a></span></p></div> <div class="comments-wrapper"><!----></div> <ul class="side-bar sub-sidebar-wrapper" style="width:12rem;" data-v-cb1513f6><li class="level-2" data-v-cb1513f6><a href="/docs/theme-reco/interactive/reactVr.html#最简单的使用" class="sidebar-link reco-side-最简单的使用" data-v-cb1513f6>最简单的使用</a></li><li class="level-2" data-v-cb1513f6><a href="/docs/theme-reco/interactive/reactVr.html#添加全部参数的使用" class="sidebar-link reco-side-添加全部参数的使用" data-v-cb1513f6>添加全部参数的使用</a></li><li class="level-2" data-v-cb1513f6><a href="/docs/theme-reco/interactive/reactVr.html#react-pannellum-实例的事件" class="sidebar-link reco-side-react-pannellum-实例的事件" data-v-cb1513f6>react-pannellum 实例的事件</a></li><li class="level-3" data-v-cb1513f6><a href="/docs/theme-reco/interactive/reactVr.html#监听事件与消除事件" class="sidebar-link reco-side-监听事件与消除事件" data-v-cb1513f6>监听事件与消除事件</a></li><li class="level-3" data-v-cb1513f6><a href="/docs/theme-reco/interactive/reactVr.html#所有的事件" class="sidebar-link reco-side-所有的事件" data-v-cb1513f6>所有的事件</a></li><li class="level-3" data-v-cb1513f6><a href="/docs/theme-reco/interactive/reactVr.html#load" class="sidebar-link reco-side-load" data-v-cb1513f6>load</a></li><li class="level-3" data-v-cb1513f6><a href="/docs/theme-reco/interactive/reactVr.html#scenechange" class="sidebar-link reco-side-scenechange" data-v-cb1513f6>scenechange</a></li><li class="level-3" data-v-cb1513f6><a href="/docs/theme-reco/interactive/reactVr.html#zoomchange" class="sidebar-link reco-side-zoomchange" data-v-cb1513f6>zoomchange</a></li><li class="level-3" data-v-cb1513f6><a href="/docs/theme-reco/interactive/reactVr.html#fullscreenchange" class="sidebar-link reco-side-fullscreenchange" data-v-cb1513f6>fullscreenchange</a></li><li class="level-3" data-v-cb1513f6><a href="/docs/theme-reco/interactive/reactVr.html#scenechangefadedone" class="sidebar-link reco-side-scenechangefadedone" data-v-cb1513f6>scenechangefadedone</a></li><li class="level-3" data-v-cb1513f6><a href="/docs/theme-reco/interactive/reactVr.html#animatefinished" class="sidebar-link reco-side-animatefinished" data-v-cb1513f6>animatefinished</a></li><li class="level-3" data-v-cb1513f6><a href="/docs/theme-reco/interactive/reactVr.html#error" class="sidebar-link reco-side-error" data-v-cb1513f6>error</a></li><li class="level-3" data-v-cb1513f6><a href="/docs/theme-reco/interactive/reactVr.html#errorcleared" class="sidebar-link reco-side-errorcleared" data-v-cb1513f6>errorcleared</a></li><li class="level-3" data-v-cb1513f6><a href="/docs/theme-reco/interactive/reactVr.html#mousedown" class="sidebar-link reco-side-mousedown" data-v-cb1513f6>mousedown</a></li><li class="level-3" data-v-cb1513f6><a href="/docs/theme-reco/interactive/reactVr.html#mouseup" class="sidebar-link reco-side-mouseup" data-v-cb1513f6>mouseup</a></li><li class="level-3" data-v-cb1513f6><a href="/docs/theme-reco/interactive/reactVr.html#touchstart" class="sidebar-link reco-side-touchstart" data-v-cb1513f6>touchstart</a></li><li class="level-3" data-v-cb1513f6><a href="/docs/theme-reco/interactive/reactVr.html#touchend" class="sidebar-link reco-side-touchend" data-v-cb1513f6>touchend</a></li><li class="level-2" data-v-cb1513f6><a href="/docs/theme-reco/interactive/reactVr.html#react-pannellum-实例的常用方法" class="sidebar-link reco-side-react-pannellum-实例的常用方法" data-v-cb1513f6>react-pannellum 实例的常用方法</a></li><li class="level-3" data-v-cb1513f6><a href="/docs/theme-reco/interactive/reactVr.html#解释一下pitch-yaw-hfov" class="sidebar-link reco-side-解释一下pitch-yaw-hfov" data-v-cb1513f6>解释一下pitch yaw hfov</a></li><li class="level-3" data-v-cb1513f6><a href="/docs/theme-reco/interactive/reactVr.html#所有方法" class="sidebar-link reco-side-所有方法" data-v-cb1513f6>所有方法</a></li><li class="level-3" data-v-cb1513f6><a href="/docs/theme-reco/interactive/reactVr.html#isloaded" class="sidebar-link reco-side-isloaded" data-v-cb1513f6>isLoaded()</a></li><li class="level-3" data-v-cb1513f6><a href="/docs/theme-reco/interactive/reactVr.html#getpitch" class="sidebar-link reco-side-getpitch" data-v-cb1513f6>getPitch()</a></li><li class="level-3" data-v-cb1513f6><a href="/docs/theme-reco/interactive/reactVr.html#setpitch-pitch-animated-callback" class="sidebar-link reco-side-setpitch-pitch-animated-callback" data-v-cb1513f6>setPitch(pitch, animated, callback)</a></li><li class="level-3" data-v-cb1513f6><a href="/docs/theme-reco/interactive/reactVr.html#getpitchbounds" class="sidebar-link reco-side-getpitchbounds" data-v-cb1513f6>getPitchBounds()</a></li><li class="level-3" data-v-cb1513f6><a href="/docs/theme-reco/interactive/reactVr.html#setpitchbounds-bounds" class="sidebar-link reco-side-setpitchbounds-bounds" data-v-cb1513f6>setPitchBounds(bounds)</a></li><li class="level-3" data-v-cb1513f6><a href="/docs/theme-reco/interactive/reactVr.html#getyaw" class="sidebar-link reco-side-getyaw" data-v-cb1513f6>getYaw()</a></li><li class="level-3" data-v-cb1513f6><a href="/docs/theme-reco/interactive/reactVr.html#setyaw-yaw-animated-callback" class="sidebar-link reco-side-setyaw-yaw-animated-callback" data-v-cb1513f6>setYaw(yaw, animated, callback)</a></li><li class="level-3" data-v-cb1513f6><a href="/docs/theme-reco/interactive/reactVr.html#getyawbounds" class="sidebar-link reco-side-getyawbounds" data-v-cb1513f6>getYawBounds()</a></li><li class="level-3" data-v-cb1513f6><a href="/docs/theme-reco/interactive/reactVr.html#setyawbounds-bounds" class="sidebar-link reco-side-setyawbounds-bounds" data-v-cb1513f6>setYawBounds(bounds)</a></li><li class="level-3" data-v-cb1513f6><a href="/docs/theme-reco/interactive/reactVr.html#gethfov" class="sidebar-link reco-side-gethfov" data-v-cb1513f6>getHfov()</a></li><li class="level-3" data-v-cb1513f6><a href="/docs/theme-reco/interactive/reactVr.html#sethfov-hfov-animated-callback" class="sidebar-link reco-side-sethfov-hfov-animated-callback" data-v-cb1513f6>setHfov(hfov, animated, callback)</a></li><li class="level-3" data-v-cb1513f6><a href="/docs/theme-reco/interactive/reactVr.html#gethfovbounds" class="sidebar-link reco-side-gethfovbounds" data-v-cb1513f6>getHfovBounds()</a></li><li class="level-3" data-v-cb1513f6><a href="/docs/theme-reco/interactive/reactVr.html#sethfovbounds-bounds" class="sidebar-link reco-side-sethfovbounds-bounds" data-v-cb1513f6>setHfovBounds(bounds)</a></li><li class="level-3" data-v-cb1513f6><a href="/docs/theme-reco/interactive/reactVr.html#getnorthoffset" class="sidebar-link reco-side-getnorthoffset" data-v-cb1513f6>getNorthOffset</a></li><li class="level-3" data-v-cb1513f6><a href="/docs/theme-reco/interactive/reactVr.html#getrenderer" class="sidebar-link reco-side-getrenderer" data-v-cb1513f6>getRenderer()</a></li><li class="level-3" data-v-cb1513f6><a href="/docs/theme-reco/interactive/reactVr.html#setupdate" class="sidebar-link reco-side-setupdate" data-v-cb1513f6>setUpdate()</a></li><li class="level-3" data-v-cb1513f6><a href="/docs/theme-reco/interactive/reactVr.html#lookat-pitch-yaw-hfov-animated-callback" class="sidebar-link reco-side-lookat-pitch-yaw-hfov-animated-callback" data-v-cb1513f6>lookAt(pitch, yaw, hfov, animated, callback)</a></li><li class="level-3" data-v-cb1513f6><a href="/docs/theme-reco/interactive/reactVr.html#startautorotate-speed" class="sidebar-link reco-side-startautorotate-speed" data-v-cb1513f6>startAutoRotate(speed)</a></li><li class="level-3" data-v-cb1513f6><a href="/docs/theme-reco/interactive/reactVr.html#stopautorotate" class="sidebar-link reco-side-stopautorotate" data-v-cb1513f6>stopAutoRotate()</a></li><li class="level-3" data-v-cb1513f6><a href="/docs/theme-reco/interactive/reactVr.html#stopmovement" class="sidebar-link reco-side-stopmovement" data-v-cb1513f6>stopMovement()</a></li><li class="level-3" data-v-cb1513f6><a href="/docs/theme-reco/interactive/reactVr.html#loadscene-sceneid-pitch-yaw-hfov" class="sidebar-link reco-side-loadscene-sceneid-pitch-yaw-hfov" data-v-cb1513f6>loadScene(sceneId, pitch, yaw, hfov)</a></li><li class="level-3" data-v-cb1513f6><a href="/docs/theme-reco/interactive/reactVr.html#getscene" class="sidebar-link reco-side-getscene" data-v-cb1513f6>getScene()</a></li><li class="level-3" data-v-cb1513f6><a href="/docs/theme-reco/interactive/reactVr.html#addscene-sceneid-config" class="sidebar-link reco-side-addscene-sceneid-config" data-v-cb1513f6>addScene(sceneId, config)</a></li><li class="level-3" data-v-cb1513f6><a href="/docs/theme-reco/interactive/reactVr.html#removescene-sceneid" class="sidebar-link reco-side-removescene-sceneid" data-v-cb1513f6>removeScene(sceneId)</a></li><li class="level-3" data-v-cb1513f6><a href="/docs/theme-reco/interactive/reactVr.html#togglefullscreen" class="sidebar-link reco-side-togglefullscreen" data-v-cb1513f6>toggleFullscreen()</a></li><li class="level-3" data-v-cb1513f6><a href="/docs/theme-reco/interactive/reactVr.html#getconfig" class="sidebar-link reco-side-getconfig" data-v-cb1513f6>getConfig()</a></li><li class="level-3" data-v-cb1513f6><a href="/docs/theme-reco/interactive/reactVr.html#getcontainer" class="sidebar-link reco-side-getcontainer" data-v-cb1513f6>getContainer()</a></li><li class="level-3" data-v-cb1513f6><a href="/docs/theme-reco/interactive/reactVr.html#addhotspot-hs-sceneid" class="sidebar-link reco-side-addhotspot-hs-sceneid" data-v-cb1513f6>addHotSpot(hs, sceneId)</a></li><li class="level-3" data-v-cb1513f6><a href="/docs/theme-reco/interactive/reactVr.html#removehotspot-hotspotid-sceneid" class="sidebar-link reco-side-removehotspot-hotspotid-sceneid" data-v-cb1513f6>removeHotSpot(hotSpotId, sceneId)</a></li><li class="level-3" data-v-cb1513f6><a href="/docs/theme-reco/interactive/reactVr.html#resize" class="sidebar-link reco-side-resize" data-v-cb1513f6>resize()</a></li><li class="level-3" data-v-cb1513f6><a href="/docs/theme-reco/interactive/reactVr.html#isorientationsupported" class="sidebar-link reco-side-isorientationsupported" data-v-cb1513f6>isOrientationSupported()</a></li><li class="level-3" data-v-cb1513f6><a href="/docs/theme-reco/interactive/reactVr.html#stoporientation" class="sidebar-link reco-side-stoporientation" data-v-cb1513f6>stopOrientation()</a></li><li class="level-3" data-v-cb1513f6><a href="/docs/theme-reco/interactive/reactVr.html#startorientation" class="sidebar-link reco-side-startorientation" data-v-cb1513f6>startOrientation()</a></li><li class="level-3" data-v-cb1513f6><a href="/docs/theme-reco/interactive/reactVr.html#isorientationactive" class="sidebar-link reco-side-isorientationactive" data-v-cb1513f6>isOrientationActive</a></li><li class="level-3" data-v-cb1513f6><a href="/docs/theme-reco/interactive/reactVr.html#on" class="sidebar-link reco-side-on" data-v-cb1513f6>on</a></li><li class="level-3" data-v-cb1513f6><a href="/docs/theme-reco/interactive/reactVr.html#off" class="sidebar-link reco-side-off" data-v-cb1513f6>off</a></li><li class="level-3" data-v-cb1513f6><a href="/docs/theme-reco/interactive/reactVr.html#destory" class="sidebar-link reco-side-destory" data-v-cb1513f6>destory()</a></li></ul></main> <!----></div></div></div></div><div class="global-ui"><div class="back-to-ceiling" style="right:1rem;bottom:6rem;width:2.5rem;height:2.5rem;border-radius:.25rem;line-height:2.5rem;display:none;" data-v-c6073ba8 data-v-c6073ba8><svg t="1574745035067" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="5404" class="icon" data-v-c6073ba8><path d="M526.60727968 10.90185116a27.675 27.675 0 0 0-29.21455937 0c-131.36607665 82.28402758-218.69155461 228.01873535-218.69155402 394.07834331a462.20625001 462.20625001 0 0 0 5.36959153 69.94390903c1.00431239 6.55289093-0.34802892 13.13561351-3.76865779 18.80351572-32.63518765 54.11355614-51.75690182 118.55860487-51.7569018 187.94566865a371.06718723 371.06718723 0 0 0 11.50484808 91.98906777c6.53300375 25.50556257 41.68394495 28.14064038 52.69160883 4.22606766 17.37162448-37.73630017 42.14135425-72.50938081 72.80769204-103.21549295 2.18761121 3.04276886 4.15646224 6.24463696 6.40373557 9.22774369a1871.4375 1871.4375 0 0 0 140.04691725 5.34970492 1866.36093723 1866.36093723 0 0 0 140.04691723-5.34970492c2.24727335-2.98310674 4.21612437-6.18497483 6.3937923-9.2178004 30.66633723 30.70611158 55.4360664 65.4791928 72.80769147 103.21549355 11.00766384 23.91457269 46.15860503 21.27949489 52.69160879-4.22606768a371.15156223 371.15156223 0 0 0 11.514792-91.99901164c0-69.36717486-19.13165746-133.82216804-51.75690182-187.92578088-3.42062944-5.66790279-4.76302748-12.26056868-3.76865837-18.80351632a462.20625001 462.20625001 0 0 0 5.36959269-69.943909c-0.00994388-166.08943902-87.32547796-311.81420293-218.6915546-394.09823051zM605.93803103 357.87693858a93.93749974 93.93749974 0 1 1-187.89594924 6.1e-7 93.93749974 93.93749974 0 0 1 187.89594924-6.1e-7z" p-id="5405" data-v-c6073ba8></path><path d="M429.50777625 765.63860547C429.50777625 803.39355007 466.44236686 1000.39046097 512.00932183 1000.39046097c45.56695499 0 82.4922232-197.00623328 82.5015456-234.7518555 0-37.75494459-36.9345906-68.35043303-82.4922232-68.34111062-45.57627738-0.00932239-82.52019037 30.59548842-82.51086798 68.34111062z" p-id="5406" data-v-c6073ba8></path></svg></div><canvas id="vuepress-canvas-cursor"></canvas><div class="kanbanniang" data-v-5775ee02><div class="banniang-container" style="display:;" data-v-5775ee02><div class="messageBox" style="right:68px;bottom:290px;display:none;" data-v-5775ee02>
      欢迎来到Zelma的博客
    </div> <div class="operation" style="right:90px;bottom:40px;display:;" data-v-5775ee02><i class="kbnfont kbn-ban-home ban-home" data-v-5775ee02></i> <i class="kbnfont kbn-ban-message message" data-v-5775ee02></i> <i class="kbnfont kbn-ban-close close" data-v-5775ee02></i> <a target="_blank" href="https://vuepress-theme-reco.recoluan.com/views/plugins/kanbanniang.html" data-v-5775ee02><i class="kbnfont kbn-ban-info info" data-v-5775ee02></i></a> <i class="kbnfont kbn-ban-theme skin" style="display:;" data-v-5775ee02></i></div> <canvas id="banniang" width="250" height="320" class="live2d" style="right:90px;bottom:-20px;opacity:0.9;" data-v-5775ee02></canvas></div> <div class="showBanNiang" style="display:none;" data-v-5775ee02>
    看板娘
  </div></div><!----><div class="RibbonAnimation"></div></div></div>
    <script src="/assets/js/app.6bff9ace.js" defer></script><script src="/assets/js/4.4f19eb35.js" defer></script><script src="/assets/js/1.085d100d.js" defer></script><script src="/assets/js/31.36528513.js" defer></script>
  </body>
</html>
